﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    Layout = null;
}
<link href="~/lib/layui/css/layui.css" rel="stylesheet" />
<script src="~/lib/layui/layui.js"></script>
<script src="~/js/js.cookie.js"></script>
<script src="~/js/moment.js"></script>
<script src="~/lib/jquery/dist/jquery.js"></script>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Demo</title>
    <!-- 请勿在项目正式环境中引用该 layui.css 地址 -->
    <link href="//unpkg.com/layui@2.9.18/dist/css/layui.css" rel="stylesheet">
</head>
<body>
    <form class="layui-form" action="">
        <div class="layui-form-item">
            <div class="layui-form-item">

                <table>
                    <tr>
                        <td>
                            <div class="layui-input-block">
                                <input type="text" id="farmFullName" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                            </div>
                        </td>
                        <td>
                            电子耳号：
                            <div class="layui-input-block">
                                <input type="text" id="recordAuricle" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                            </div>
                        </td>
                        
                    </tr>


                    <tr>
                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">品种</label>
                                <div class="layui-input-block">
                                    <input type="text" id="recordBreed" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">性别</label>
                                <div class="layui-input-block">
                                    <input type="text" id="sex" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">父耳号</label>
                                <div class="layui-input-block">
                                    <input type="text" id="recordFather" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">母耳号</label>
                                <div class="layui-input-block">
                                    <input type="text" id="recordMother" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">出生日期</label>
                                <div class="layui-input-block">
                                    <input type="text" id="recordDate" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">出生重</label>
                                <div class="layui-input-block">
                                    <input type="text" id="recordWeight" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>
                    </tr>


                    <tr>
                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">出生场地</label>
                                <div class="layui-input-block">
                                    <input type="text" id="recordRemark" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">断奶日龄</label>
                                <div class="layui-input-block">
                                    <input type="text" id="weanDate" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">断奶重</label>
                                <div class="layui-input-block">
                                    <input type="text" id="salesGrade" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">日龄</label>
                                <span id="daysOld"></span>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">月龄</label>
                                <span id="monthsOld"></span>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">同胎数</label>
                                
                            </div>
                        </td>
                    </tr>


                    <tr>
                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">当前胎次</label>
                                
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">已产胎次</label>
                                
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">配种序号</label>
                                <div class="layui-input-block">
                                    <input type="text" id="recordCorpuscle" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>
                       
                    </tr>


                    <tr>
                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">创建人</label>
                                <div class="layui-input-block">
                                    <input type="text" id="createdOwnerId" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">修改人</label>
                                <div class="layui-input-block">
                                    <input type="text" id="updatedOwnerId" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">创建时间</label>
                                <div class="layui-input-block">
                                    <input type="text" id="createdTime" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item">
                                <label class="layui-form-label">修改时间</label>
                                <div class="layui-input-block">
                                    <input type="text" id="gene1" lay-verify="required" placeholder="请输入" autocomplete="updatedTime" class="layui-input">
                                </div>
                            </div>
                        </td>

                    </tr>

                </table>


                <table>
                    

                    <tr>
                        <td>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <input type="text" id="recordAuricle" lay-verify="required" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </td>

                        <td>
                            <div class="layui-form-item" >
                                <div class="layui-input-block">
                                    <input type="text" id="recordFather" lay-verify="required" autocomplete="off" class="layui-input" style="background-color:cornflowerblue">
                                </div>
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <td></td>

                        <td>
                            <div class="layui-form-item" >
                                <div class="layui-input-block">
                                    <input type="text" id="recordMother" lay-verify="required" autocomplete="off" class="layui-input" style="background-color:palevioletred">
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>

            </div>
        </div>
    </form>


    <!-- 请勿在项目正式环境中引用该 layui.js 地址 -->
    <script src="//unpkg.com/layui@2.9.18/dist/layui.js"></script>
    <script>
        layui.use(function () {
            var form = layui.form;
            var layer = layui.layer;

        });
    </script>
</body>
</html>

<script>
    layui.use(function () {
        var form = layui.form;
        var layer = layui.layer;

        FanT();
        GetData()

        //反填
        function FanT() {
            var recordAuricle = localStorage["recordAuricle"];
            console.log(recordAuricle)
            $.post({
                url: "http://localhost:5269/api/SheepArchive/SheepArchivesDetail",
                data:
                    JSON.stringify({
                        recordAuricle: recordAuricle
                    }),

                async: false,
                dataType: "json",
                contentType: "application/json",
                success: function (res) {
                    console.log(res.data)
                    $(res.data).each(function () {
                        $("#gene").val(this.gene)
                        $("#admissionDate").val(this.admissionDate)
                        
                        $("#recordMother").val(this.recordMother)
                        $("#recordFather").val(this.recordFather)
                        $("#recordBreed").val(this.recordBreed)
                        $("#recordDate").val(this.recordDate)
                        $("#recordBorn").val(this.recordBorn)
                        $("#recordSite").val(this.recordSite)
                        $("#recordWeight").val(this.recordWeight)
                        $("#sex").val(this.sex)
                        $("#farmFullName").val(this.farmFullName)
                        $("#createdOwnerId").val(this.createdOwnerId)
                        $("#createdTime").val(this.createdTime)
                        $("#updatedTime").val(this.updatedTime)
                        $("#deletedOwnerId").val(this.deletedOwnerId)
                        form.render('select');
                    });
                }

            })
        }
        console.log(2222);


        //系谱图
        function GetData() {

        }

    });

</script>